using System;
using System.Collections.Generic;
using System.Net;
using System.Text;

using Google.GData.Apps;
using Google.GData.Client;
using Google.Documents;

namespace GDocBackupLib
{
    /*
    public class StandardUserDocumentRetriever : DocumentRetriever
    {
        private string _userName; 
        private string _password;
        private IWebProxy _iwebproxy;
        private DocumentsRequest _request;

        public StandardUserDocumentRetriever(string username, string password, IWebProxy iwebproxy)
        {
            _userName = username;
            _password = password;
            _iwebproxy = iwebproxy;
        }

        public override DocumentsRequest GetDocumentsRequest(string resourceID)
        {
            if (_request == null)
            {
                RequestSettings settings = GetRequestSettings();
                settings.AutoPaging = AUTO_PAGING;
                settings.PageSize = PAGE_SIZE;
                _request = new DocumentsRequest(settings);
            }
            return _request;
        }

        protected override RequestSettings GetRequestSettings()
        {
            if (_userName == null || _password == null)
            {
                throw new Exception("Username and password must be specified");
            }
            GDataCredentials credentials = new GDataCredentials(_userName, _password);
            return new RequestSettings("GDocBackup", credentials);
        }

        public override List<Document> GetAllFolders()
        {
            return null;
        }

        public override List<Document> GetAllDocuments()
        {
            if (_iwebproxy != null)
            {
                GDataRequestFactory gdrf = _request.Service.RequestFactory as GDataRequestFactory;
                gdrf.Proxy = _iwebproxy;

                // BETTER/FUTURE SOLUTION (DocumentsRequest.Proxy property will be available in the next release of the GDoc NET Lib)
                // (see http://code.google.com/p/google-gdata/issues/detail?id=234  )
                //
                // request.Proxy = _iwebproxy;
                //
            }

            // Get doc list from GDocs
            Feed<Document> feed = _request.GetEverything();
            List<Document> docs = new List<Document>();
            foreach (Document entry in feed.Entries)
                docs.Add(entry);

            return docs;
        }
    }*/
}
